﻿//
var hjdict_host="dict.hjenglish.com";
//
//word: 单词
//comment: 解释，如为空，有小D自动提取
//langs: 翻译语言方向，en中英自动判断,ce中英,ec英中,cj中日,jc日中
//callbackfunction: 回调函数名，需全局函数
//taskid: 任务序号标记，包含于结果对象中
//返回结果：{taskid:,word:,retvalue:}  
function hjdict_addmyword(word, comment, langs, callbackfunction, taskid){
	if(!comment){comment="";}
	if(!langs){langs="ec";}
	if(!taskid){taskid=0;}
	if(!callbackfunction){callbackfunction="addmyword_callback";}
	var element=document.createElement('script'); 
	var callUrl="http://"+ hjdict_host +"/services/addmyword.aspx?ran="+Math.random()+"&tid="+ taskid;
	callUrl+= "&cb="+ callbackfunction +"&w="+ encodeURI(word) +"&c="+ encodeURI(comment) +"&langs="+langs;
	element.setAttribute('src', callUrl);
	document.body.appendChild(element);
}